{layout name='./base/base_back'}
	<link rel="stylesheet" type="text/css" href="/front/css/publishWish.css"/>
	<link rel="stylesheet" type="text/css" href="/front/css/wishList.css"/>
	<link rel="stylesheet" type="text/css" href="/front/css/jquery-ui.css"/>
	<script src="/front/js/jquery.js"></script>
	<script src="/front/js/jquery-ui.js"></script>
	<script src="/front/js/weifeng.js"></script>
	<script src="/front/js/jquery.cxselect.js"></script>
	<style type="text/css">
		#addressD {
		  padding-top: 25px;
		  padding-left: 100px;
		}
		#addressD .dizhi {
		  display: inline-block;
		  width: 150px;
		  text-align: right;
		  padding-right: 25px;
		  font-size: 14px;
		}
		#addressD .exchange-city-list{
		    padding: 3px 0px 3px 13px;
		    border: 1px solid #CCCCCC;
		    margin-right: 5px;
		    cursor: pointer;
		}
		#addressD .exchange-city-list:hover {
		    color: #217fc4;
		    background:#eee;
		}
	</style>
	<!--发布心愿开始-->
	<div id="publish-wish-box">
		<div id="publish-wish">
			{include file='./navleft'}
			<div class="publish-wish-right">
				<div class="publish-wish-tit">发布心愿</div>
				<form action="javaScript:;" method="post">
					<div class="publish-wish-form">
						<div id="addressD">
							<label class="dizhi">出行目的地</label>
							{foreach $region as $k=>$v}
								{if $k==='Beijing'}
								<label for="{$k}" class="exchange-city-list" style="background-color: #1E90FF; color: #FFFFFF;">
									{$v}<input type="radio" name="region" id="{$k}" value="{$k}" checked="true" style="visibility: hidden;"/>
								</label>
								{else /}
								<label for="{$k}" class="exchange-city-list">
									{$v}<input type="radio" name="region" id="{$k}" value="{$k}" style="visibility: hidden;"/>
								</label>
								{/if}
							{/foreach}
						</div>
						<script type="text/javascript">
							$(function(){
								$("#addressD .exchange-city-list").click(function(){
									$(this).css({backgroundColor:"#1E90FF",color:"#FFFFFF"}).siblings('.exchange-city-list').css({backgroundColor:"",color:""});
								})
							})
						</script>
						<div class="form-group-input">
							<label for="">出行起止日期</label>
							<input type="text" name="start_date" value="" id="_startDate" placeholder="请输入开始日期"/>
							<span>至</span>
							<input type="text" name="end_date" value="" id="_endDate" placeholder="请输入结束日期"/>
						</div>
						<!--删除悬赏现金-->
						<div class="form-group-input">
							<label for="">悬赏旅行币</label>
							<input type="text" name="travel_coin" value="" placeholder="请输入悬赏旅行币"/>
						</div>
						<div class="form-group-input">
							<button id="submit">发布</button>
						</div>
						<dl>
							<dt>温馨提示</dt>
							<dd>1. 请您填写自己的真实心愿。对于捏造虚假信息进行填写的，一旦发现，双辉旅程网有权关闭您的会员账号。</dd>
							<dd>2. 一旦发布心愿后，您不能随意修改、删除。请谨慎填写您的发布信息。</dd>
							<dd>3. 对于您发布的心愿，一旦有会员接单，系统会自动发送消息通知您，请您在24小时内即时给予同意/拒绝的确认。只有经过发布心愿方的确认，订单才正式生效。由于您没有及时进行确认反馈造成的任何损失，双辉将不承担责任</dd>
							<dd>4. 订单确认后，系统将会自动扣除您进行此次交换花费的旅行币。旅行币详情，请您在我的双辉->旅行币管理页面进行查看。</dd>
							<dd>5. 订单一旦生效，系统自动会发送订单信息给您，请您安排好自己的出行计划，按时入住。</dd>
						</dl>
					</div>
				</form>
			</div>
		</div>
	</div>
	<!--发布心愿结束-->
	
	<!--接单规则弹出框开始-->
		<div id="receiving-rule" style="display: none;">
			<div class="receiving-rule-bg"></div>
			<div class="receiving-rule-bounced">
				<div class="rule-bounced" style="background:#fff;">
					<p>温馨提示! <span id="closeSpan" style="float: right;margin-right: 10px; cursor: pointer;">关闭</span></p>
					<dl>
						<dt></dt>
					</dl>
					<div class="rule-bounced-button" style="padding-left:152px">
						<a id="quxiao" href="/setcaravan/sharecaravan">去分享</a>
					</div>
				</div>
			</div>
		</div>
	<!--接单规则弹出框结束-->
	<script type="text/javascript">
		$('#submit').click(function(){
			var data = $('form').serialize();
			$.ajax({
				type:"post",
				url:"/wishs/save?"+Math.random(),
				data:data,
				dataType:'json',
				success:function(data){
					if(data.code===20003){
						$('#receiving-rule').show();
						$('#receiving-rule dt').html(data.message);
						return false;
					}
					if(data.code===60007 || data.code===60006){
						$('#receiving-rule').show();
						$('#receiving-rule dt').html(data.message);
						$('#receiving-rule .rule-bounced-button').hide();
						return false;
					}
					if(data.code===1){
						location.href = '/Wishs/index';
					}
				}
			});
		})
		
		$('#closeSpan').click(function(){
			$('#receiving-rule').hide();
		})
		
		//世界城市地区联动 开始
		$('#addressD').cxSelect({
		    selects: ['addressCountry','addressProvince', 'addressCity','addressQu'],
		    jsonName: 'area_name',
		    jsonValue: 'area_code'  }, function(api) {
		    cxSelectApi = api;
		});
		//世界城市地区联动 结束
		
		$("#_startDate,#_endDate").datepicker({
		    showOtherMonths: true,
		    selectOtherMonths: true,
		    minDate:0,
		    onSelect:function(dateText,inst){
	  		$("#_endDate").datepicker("option","minDate",dateText);
	        //$("#_endDate").datepicker("option","maxDate",dateText);
			}
		});
		
	</script>
